package com.youlai.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youlai.system.model.entity.HisCareHistory;
import com.youlai.system.model.query.HisCareHistoryQuery;
import com.youlai.system.service.HisCareHistoryService;
import com.youlai.system.mapper.HisCareHistoryMapper;
import org.springframework.stereotype.Service;

/**
* @author 86177
* @description 针对表【his_care_history(病例表)】的数据库操作Service实现
* @createDate 2024-09-04 15:38:47
*/
@Service
public class HisCareHistoryServiceImpl extends ServiceImpl<HisCareHistoryMapper, HisCareHistory>
    implements HisCareHistoryService{

    @Override
    public IPage<HisCareHistory> listPageHistroy(HisCareHistoryQuery queryParams) {
        IPage<HisCareHistory> page = new Page<>(queryParams.getPageNum(), queryParams.getPageSize());
        QueryWrapper<HisCareHistory> wrapper = new QueryWrapper<>();
        if (queryParams.getChId() != null) {
            wrapper.like("ch_id", queryParams.getChId());
        }
        return this.page(page, wrapper);
    }
}




